package com.homework0425.race;

public class Tortoise extends Thread{
    private int distance = 10;



    @Override
    public void run() {

        long starttime = System.currentTimeMillis();
        while (distance>0){

            try{
                Thread.sleep(13);
                distance--;
                System.out.println("乌龟跑了1KM剩余"+distance+"km");

            }catch (Exception e){
                System.out.println(e);
            }

        }
        long endtime = System.currentTimeMillis();
        System.out.println("乌龟完成比赛！"+"用时："+(endtime-starttime)+"分钟");

    }



}
